#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
@author:shengwei
@file:requests_py.py
@time:2018/2/26 002615:41
"""
import requests

# r = requests.get('https://www.douban.com/') # 豆瓣首页
# r = requests.get('https://www.douban.com/search', params={'q': 'python', 'cat': '1001'})
r = requests.get('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%202151330&format=json')
r.url,r.status_code, r.url, r.encoding,r.json()  # 实际请求的URL
print(r.headers['Content-Type'])
